#include <iostream>
#include <vector>
using namespace std;
 
int main()
{
    vector<bool> arr(10, false);
    string str, ret;
    cin >> str;
    for(int i = str.size() - 1; i >= 0; --i)
    {
        if(arr[str[i] - '0'] == false)
        {
            ret += str[i];
            arr[str[i] - '0'] = true;
        }
    }
    cout << atoi(ret.c_str()) << endl;
    return 0;
}